
// Simple232Dlg.h : header file
//

#pragma once
#include "afxwin.h"
#include "afxcmn.h"


// CSimple232Dlg dialog
class CSimple232Dlg : public CDialogEx
{
// Construction
public:
	CSimple232Dlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_SIMPLE232_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
    //Settings
    CComboBox m_combox_id_;
    CComboBox m_combox_baud_;
    CComboBox m_combox_bits_;
    CComboBox m_combox_parity_;
    CComboBox m_combox_stopbits_;

    //Button
    CButton m_button_open_;
    CButton m_button_close_;

    //Output and status
    CListCtrl m_listctrl_output_;
    CEdit m_edit_status_;

    BOOL PreTranslateMessage(MSG* pMsg);
    afx_msg void OnDestroy();
    afx_msg void OnBnClickedButtonOpen();
    afx_msg void OnBnClickedButtonClose();
    afx_msg LRESULT OnComReceivedByte(WPARAM cbyte, LPARAM lparam);
    afx_msg LRESULT OnComSendByte(WPARAM cbyte, LPARAM lparam);
    afx_msg LRESULT OnUpdateCounter(WPARAM wparam, LPARAM lparam);

private:
    OVERLAPPED  overlappedWrite_;
    int sentBytes_;
    int receivedBytes_;
};
